package GUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTabbedPane;
import java.awt.GridLayout;
import javax.swing.JSplitPane;
import javax.swing.JList;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class HauptFenster extends JFrame
{

	private JPanel contentPane;
	private JButton btNeu;
	private JButton btSpeichern;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args)
	{
		EventQueue.invokeLater(new Runnable() {
			public void run()
			{
				try
				{
					HauptFenster frame = new HauptFenster();
					frame.setVisible(true);
				} catch (Exception e)
				{
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public HauptFenster()
	{
		setResizable(false);
		setTitle("Hotelverwaltung");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 484, 378);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JPanel panel = new JPanel();
		contentPane.add(panel, BorderLayout.CENTER);
		panel.setLayout(new BorderLayout(0, 0));
		
		JSplitPane splitPane = new JSplitPane();
		panel.add(splitPane, BorderLayout.CENTER);
		
		JList list = new JList();
		splitPane.setRightComponent(list);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		splitPane.setLeftComponent(tabbedPane);
		
		ZimmerEditor zimmerEditor = new ZimmerEditor();
		tabbedPane.addTab("Zimmer anlegen", null, zimmerEditor, null);
		
		JPanel panel_1 = new JPanel();
		zimmerEditor.add(panel_1, BorderLayout.SOUTH);
		
		btNeu = new JButton("Neues Zimmer");
		btNeu.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				do_btNeu_actionPerformed(arg0);
			}
		});
		panel_1.add(btNeu);
		
		btSpeichern = new JButton("Speichern");
		btSpeichern.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				do_btSpeichern_actionPerformed(arg0);
			}
		});
		panel_1.add(btSpeichern);
	}

	protected void do_btNeu_actionPerformed(ActionEvent arg0) {
	
	}
	protected void do_btSpeichern_actionPerformed(ActionEvent arg0) {
	}
}
